<?

function debug($was, $type="var_dump") {
	if($type==="var_dump") {
		echo "<pre>";
		var_dump($was);
		echo "</pre>";
	} else if($type==="print_r") {
		echo "<pre>";
		print_r($was);
		echo "</pre>";
	}
}

function profile($marker = "") {
	debug("$marker Memory: " . (memory_get_usage() / 1024) / 1024 . " MB \n", "print_r");
}